package com.cdl.enums;

import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * @author cdl
 * @date 2025/10/4
 */
public class EnumTest {
    public static void main(String[] args) {

        //Scanner in = new Scanner(System.in);
        //System.out.println("Enter a size: (SMALL,MEDIUM,LARGE,EXTRA_LARGE)");
        //String input = in.next().toUpperCase();
        //
        //Size size = Enum.valueOf(Size.class,input);
        //System.out.println("size = "+ size);
        //System.out.println("abbreviation = " +size.getAbbreviation());
        //
        //if (size == Size.EXTRA_LARGE){
        //    System.out.println("Good job--you paid attention to  the _.");
        //}

        Day day = Day.FRIDAY;
        System.out.println("today is " + day.toString());
        System.out.println("nextday is " + day.nextDay().toString());


    }

}

enum Size{
    SMALL("S"), MEDIUM("M"), LARGE("L"), EXTRA_LARGE("XL");
    private  String abbreviation;
    private Size(String abbreviation){
        this.abbreviation =abbreviation;
    }
    public String getAbbreviation(){
        return abbreviation;
    }
}

enum Day{
    MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY;
    public Day nextDay(){
        switch (this){
            case MONDAY:return TUESDAY;
            case TUESDAY:return WEDNESDAY;
            case WEDNESDAY:return THURSDAY;
            case THURSDAY:return FRIDAY;
            case FRIDAY:return SATURDAY;
            case SATURDAY:return SUNDAY;
            case SUNDAY:return MONDAY;
            default:throw new IllegalStateException("Unknown day:" + this);
        }
    }
}